package com.blb.generator.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blb.generator.entity.Staff;
import com.blb.generator.entity.dto.StaffDto;
import com.blb.generator.mapper.StaffMapper;
import com.blb.generator.service.StaffService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yl
 * @since 2022-02-21
 */
@Service
public class StaffServiceImpl extends ServiceImpl<StaffMapper, Staff> implements StaffService {
private final StaffMapper staffMapper;

    public StaffServiceImpl(StaffMapper staffMapper) {
        this.staffMapper = staffMapper;
    }

    @Override
    public List<StaffDto> getList(Page<StaffDto> page, @Param(Constants.WRAPPER) Wrapper wrapper) {
        return staffMapper.findStaffDto(page,wrapper);
    }

    @Override
    public List<StaffDto> getList(Page<StaffDto> page) {
        return staffMapper.getStaffDtoByPage(page);
    }
}
